package com.xiangge.qicaixianhua;

import java.util.Scanner;

/**
 * @author xiyu
 * @version 1.0
 * @date 2025/3/18 16:25
 * @description 测试类
 */
public class FlowerTest {
    public static void main(String[] args) {
        Flower[] flowers = init();//初始化

        Scanner input = new Scanner(System.in);//创建输入对象

        while (true) {
            System.out.println("=========欢迎光临”七彩鲜花“销售管理系统==================");
            System.out.println("1.查询销售订单");
            System.out.println("2.修改销售订单");
            System.out.println("3.删除销售订单");
            System.out.println("4.增加销售订单");
            System.out.println("5.系统退出");
            System.out.println("===================================================");
            System.out.print("请输入菜单选项：");
            int next = input.nextInt();
            switch (next){
                case 1://查询
                    FlowerMgr.findAll(flowers);
                    break;
                case 2://修改
                    FlowerMgr.revise(flowers);
                    break;
                case 3://删除
                    FlowerMgr.del(flowers);
                    break;
                case 4://增加
                    FlowerMgr.add(flowers);
                    break;
                default:
                    System.out.println("已退出");
                    return;
            }
        }


    }

    private static Flower[] init() {
        Flower f1 = new Flower("1001", "金色海岸-香槟玫瑰", 10, 318.0, "2016-12-12", "王二呢", "");
        Flower f2 = new Flower("1002", "初心永不变-白玫瑰", 99, 538.0, "2016-12-20", "张欣雨", "");
        Flower f3 = new Flower("1003", "梦里花开-紫色桔梗", 40, 148.0, "2016-12-24", "王二呢", "眼波如水，映出窗外繁星点点");
        Flower f4 = new Flower("1004", "心花怒放-粉香百合", 120, 188.0, "2016-12-26", "王二呢", "内层银灰色厚棉纸，外层深蓝色条纹纸，银灰色缎带");
        Flower f5 = new Flower("1005", "致青春一-无声的爱", 100, 219.0, "2016-12-18", "张欣雨", "我爱你，胜过爱爱情，更胜过爱自己!");

        Flower[] flowers = new Flower[10];
        flowers[0] = f1;
        flowers[1] = f2;
        flowers[2] = f3;
        flowers[3] = f4;
        flowers[4] = f5;

        return flowers;
    }
}
